
#if !defined(__KEYWORD_DLG)
#define __KEYWORD_DLG

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "ExListViewCtrl.h"
#include "Resource.h"
#include "PropPage.h"

class KeywordDlg : public CDialogImpl<KeywordDlg>
{
	CEdit ctrlKeyword;
	CButton ctrlAddKeyword;
	CButton ctrlChangeKeyword;
	CButton ctrlRemoveKeyword;
	ExListViewCtrl ctrlKeywordList;
	CComboBox ctrlType;

	StringList kList, lList, oList;

	int curSel;

public:

	enum { IDD = IDD_KEYWORD };

	BEGIN_MSG_MAP(KeywordDlg)
		MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
		MESSAGE_HANDLER(WM_SETFOCUS, onFocus)
		COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
		COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
		COMMAND_ID_HANDLER(IDC_ADD, onAdd)
		COMMAND_ID_HANDLER(IDC_CHANGE, onChange)
		COMMAND_ID_HANDLER(IDC_REMOVE, onRemove)
		COMMAND_CODE_HANDLER(CBN_SELCHANGE, onSelChange)
	END_MSG_MAP()

	KeywordDlg() { };
	virtual ~KeywordDlg() { };

	LRESULT onFocus(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) {
		ctrlKeyword.SetFocus();
		return FALSE;
	}

	LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
	LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onAdd(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onRemove(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	LRESULT onSelChange(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
		updateList();
		return 0;
	};

	void updateList();
};

#endif // !defined(__KEYWORD_DLG)